package com.sx.pipeline.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.sx.pipeline.R
import com.sx.pipeline.repos.http.res.MessageListVo

/**
 * @Author：YY
 * @Date：2022/2/10
 * @Describe: 消息列表适配器
 */
class MessageListAdapter(dataList: MutableList<MessageListVo>) : BaseQuickAdapter<MessageListVo, BaseViewHolder>(
    R.layout.item_message_list, dataList) {

    override fun convert(holder: BaseViewHolder, item: MessageListVo) {
        holder.setText(R.id.tv_title,item.title)
        holder.setText(R.id.tv_time,item.createTime)

        if (!item.haveRead){
            holder.setVisible(R.id.tv_involved_num,true)
        }else{
            holder.setVisible(R.id.tv_involved_num,false)
        }
    }
}